package com.cjj.service.impl;

import com.cjj.service.TInterposeSchemeService;
import com.cjj.vo.ClassifyVo;
import com.cjj.vo.TNumberVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.mapper.TInterposeSchemeMapper;
import com.guigu.mapper.TInterveneModelMapper;
import com.guigu.mapper.TMemberMapper;
import com.guigu.pojo.TInterposeScheme;
import com.guigu.pojo.TInterveneModel;
import com.guigu.pojo.TMember;
import com.guigu.viwe.PageVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TInterposeSchemeServiceImpl implements TInterposeSchemeService {
    @Resource
    private TMemberMapper tMemberMapper;
    @Resource
    private TInterveneModelMapper tInterveneModelMapper;

    @Resource
    private TInterposeSchemeMapper tInterposeSchemeMapper;
    @Override
    public PageInfo<TNumberVo> queryTInterposeScheme(PageVo<TNumberVo> tMemberPageVo) {
        PageHelper.startPage(tMemberPageVo.getCurrentPage(), tMemberPageVo.getPageSize());
        PageInfo<TNumberVo> ClassifyPageInfo = new PageInfo<>(this.tMemberMapper.queryTInterposeScheme(tMemberPageVo.getCondition()));
        return ClassifyPageInfo;
    }
//查询所有模板
    @Override
    public List<TInterveneModel> queryOption() {
        return this.tInterveneModelMapper.queryOption();
    }
//    查询选中的模板
    @Override
    public TInterveneModel changeModel(String id) {
        return this.tInterveneModelMapper.changeModel(id);

    }
    //制订方案
    @Override
    public int addIntervent(TInterposeScheme tInterposeScheme) {

        return this.tInterposeSchemeMapper.addIntervent(tInterposeScheme);
    }
}
